﻿using System;
using System.Data.OleDb;
using System.Windows.Forms;

namespace Texpro
{

    public partial class FMMN102 : Form
    {

        public FMMN102()
        {
            InitializeComponent();
        }

        //
        // EVENTS
        //

        private void FMMN102_Load(object sender, EventArgs e)
        {
            if (PCPUB.m_user_logged_in)
            {
                set_main_ssb();
                set_user_role_menu(PCPUB.m_user_id);
            }
            else
            {
                Application.Exit();
            }
        }

        private void FMMN102_Resize(object sender, EventArgs e)
        {
            resize_images();
        }

        private void FMMN102_MdiChildActivate(object sender, EventArgs e)
        {
            String main_title = "Main";
            try
            {
                main_title = this.ActiveMdiChild.Text;
                PCPUB.m_form_id = this.ActiveControl.Tag.ToString();
            }
            catch
            {
                main_title = "Main";
                PCPUB.m_form_id = this.Tag.ToString();
            }
            this.lbl_main_title.Text = main_title;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            set_main_ssb();
            timer1.Enabled = false;
        }

        //
        // GENERAL
        //

        private void resize_images()
        {
            lbl_main_title.Top = 1;
            lbl_main_title.Left = pb_hl.Left + pb_hl.Width;
            lbl_main_title.Height = pnl_t3.Height - 2;
            lbl_main_title.Width = 400;
            //
            lbl_tran_date.Top = lbl_org_name.Top;
            lbl_tran_date.Height = lbl_org_name.Height;
            lbl_tran_date.Width = 300;
            lbl_tran_date.Left = pnl_t1.Width - (lbl_tran_date.Width + pb_tr.Width);
            //
            PCPUB.m_mdi_child_top = 0;
            PCPUB.m_mdi_child_left = 0;
            PCPUB.m_mdi_child_height = this.Height - (pnl_t1.Height + pnl_t2.Height + pnl_t3.Height + pnl_t4.Height) - 5;
            PCPUB.m_mdi_child_width = this.Width - 5;
        }

        private void set_user_role_menu(String p_user_id)
        {
            try
            {
                tsmi_file.Enabled = true;
                tsmi_FMTR003.Enabled = false;
                tsmi_tran.Enabled = false;
                tsmi_admin.Enabled = false;
                tsmi_report.Enabled = false;
                tsmi_window.Enabled = false;
                tsmi_help.Enabled = false;
                if (PCPUB.m_tran_date.DayOfWeek.ToString().Equals("Sunday"))
                {
                    tsmi_FMTR003.Enabled = true;
                    PCMSG.ShowError("Transactions are not allowed in 'Sunday'. Please change date to day other than 'Sunday'."); 
                }
                else if (PCPUB.m_user_role_id.Equals("ADMIN"))
                {
                    tsmi_admin.Enabled = true;
                }
                else
                {
                    tsmi_FMTR003.Enabled = true;
                    tsmi_tran.Enabled = true;
                    tsmi_report.Enabled = true;
                }

            }
            catch (Exception e)
            {
                tsmi_file.Enabled = true;
                tsmi_FMTR003.Enabled = false;
                tsmi_tran.Enabled = false;
                tsmi_admin.Enabled = false;
                tsmi_report.Enabled = false;
                tsmi_window.Enabled = false;
                tsmi_help.Enabled = false;
            }
        }

        public void set_main_ssb()
        {
            lbl_tran_date.Text = PCPUB.m_tran_date.ToString("dd/MM/yyyy (dddd)");
            lbl_org_name.Text = PCPUB.mc_org_name.ToString();// +"\n" + PCPUB.mc_org_city.ToString();
            lbl_user_name.Text = "User: " + PCPUB.m_user_name.ToString() + " (" + PCPUB.m_user_id.ToString() + ")";
            lbl_user_role.Text = "Role: " + PCPUB.m_user_role_name.ToString() + " (" + PCPUB.m_user_role_id.ToString() + ")";
            lbl_version.Text = PCPUB.mc_app_version + " (" + PCPUB.mc_app_build + ")";
        }
        
        private void load_form_report(String p_child_title)
        {
            Form childForm = new FMMN105();
            this.lbl_main_title.Text = p_child_title;
            childForm.MdiParent = this;
            childForm.Text = p_child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.Show();
        }

        private void load_form_child(String p_child_title)
        {
            Form childForm = new FMMN103();
            this.lbl_main_title.Text = p_child_title;
            childForm.MdiParent = this;
            childForm.Text = p_child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.Show();
        }

        // file

        private void tsmi_file_close_Click(object sender, EventArgs e)
        {
            DialogResult dr;
            if (this.ActiveMdiChild != null)
            {
                dr = PCMSG.Show("Do you want to close '" + this.ActiveMdiChild.Text.ToString() + "'?", "Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.Yes)
                {
                    this.ActiveMdiChild.Close();
                }
                this.Refresh();
            }
        }

        private void tsmi_file_close_all_Click(object sender, EventArgs e)
        {
            DialogResult dr;
            int cf = 0;
            foreach (Form childForm in MdiChildren)
            {
                cf++;
            }
            if (cf > 0)
            {
                dr = PCMSG.Show("Do you want to close all?", "Close All", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.Yes)
                {
                    foreach (Form childForm in MdiChildren)
                    {
                        childForm.Close();
                    }
                }
                this.Refresh();
            }
        }

        private void tsmi_FMAD105_Click(object sender, EventArgs e)
        {
            Form childForm = new FMAD105();
            DialogResult dr;
            int cf = 0;
            foreach (Form mdiChildForm in MdiChildren)
            {
                cf++;
            }
            if (cf > 0)
            {
                dr = PCMSG.Show("Change Date option will close all forms. Click 'OK' to proceed or 'Cancel' to abort.", "Change Date", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (dr == DialogResult.OK)
                {
                    foreach (Form mdiChildForm in MdiChildren)
                    {
                        mdiChildForm.Close();
                    }
                }
            }
            else
            {
                dr = PCMSG.Show("Do you want to change date?", "Change Date", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
            }
            this.Refresh();
            if (dr == DialogResult.Yes || dr == DialogResult.OK)
            {
                PCPUB.m_form_id = String.Empty;
                String child_title = "Change Date";
                childForm.Text = child_title;
                childForm.Tag = PCPUB.m_form_id;
                childForm.ShowDialog();
                set_main_ssb();
                set_user_role_menu(PCPUB.m_user_id);
            }
        }

        private void tsmi_FMMN203_Click(object sender, EventArgs e)
        {
            DialogResult dr;
            dr = PCMSG.Show("Do you want to change password?", "Change Password", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
            if (dr == DialogResult.Yes)
            {
                PCPUB.m_form_option_code = "FMMN203";
                String child_title = "Change Password";
                Form childForm = new FMMN203();
                childForm.Text = child_title;
                childForm.ShowDialog();
            }
            this.Refresh();
        }

        private void tsmi_file_exit_Click(object sender, EventArgs e)
        {
            DialogResult dr;
            dr = PCMSG.Show("Do you want to exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
            if (dr == DialogResult.Yes)
            {
                Application.Exit();
            }
            this.Refresh();
        }

        // transaction

        private void tsmi_FMTR101_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR101_open)
            {
                PCPUB.m_FMTR101_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR101_ID.ToString();
                String child_title = Properties.Resources.FMTR101_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR102_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR102_open)
            {
                PCPUB.m_FMTR102_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR102_ID.ToString();
                String child_title = Properties.Resources.FMTR102_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR103_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR103_open)
            {
                PCPUB.m_FMTR103_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR103_ID.ToString();
                String child_title = Properties.Resources.FMTR103_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR201_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR201_open)
            {
                PCPUB.m_FMTR201_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR201_ID.ToString();
                String child_title = Properties.Resources.FMTR201_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR202_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR202_open)
            {
                PCPUB.m_FMTR202_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR202_ID.ToString();
                String child_title = Properties.Resources.FMTR202_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR301_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR301_open)
            {
                PCPUB.m_FMTR301_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR301_ID.ToString();
                String child_title = Properties.Resources.FMTR301_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR302_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR302_open)
            {
                PCPUB.m_FMTR302_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR302_ID.ToString();
                String child_title = Properties.Resources.FMTR302_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR303_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR303_open)
            {
                PCPUB.m_FMTR303_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR303_ID.ToString();
                String child_title = Properties.Resources.FMTR303_TEXT.ToString();
                load_form_child(child_title);
            }
        }


        private void tsmi_FMTR401_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR401_open)
            {
                PCPUB.m_FMTR401_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR401_ID.ToString();
                String child_title = Properties.Resources.FMTR401_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR402_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR402_open)
            {
                PCPUB.m_FMTR402_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR402_ID.ToString();
                String child_title = Properties.Resources.FMTR402_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR501_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR501_open)
            {
                PCPUB.m_FMTR501_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR501_ID.ToString();
                String child_title = Properties.Resources.FMTR502_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR502_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR502_open)
            {
                PCPUB.m_FMTR502_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR502_ID.ToString();
                String child_title = Properties.Resources.FMTR502_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tdmi_FMTR601_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR601_open)
            {
                PCPUB.m_FMTR601_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR601_ID.ToString();
                String child_title = Properties.Resources.FMTR601_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        private void tsmi_FMTR602_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR602_open)
            {
                PCPUB.m_FMTR602_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR602_ID.ToString();
                String child_title = Properties.Resources.FMTR602_TEXT.ToString();
                load_form_child(child_title);
            }
        }


        private void tsmi_FMTR603_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMTR603_open)
            {
                PCPUB.m_FMTR603_open = true;
                PCPUB.m_form_id = Properties.Resources.FMTR603_ID.ToString();
                String child_title = Properties.Resources.FMTR603_TEXT.ToString();
                load_form_child(child_title);
            }
        }

        // admin

        private void tsmi_FMAD101_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD101_open)
            {
                PCPUB.m_FMAD101_open = true;
                PCPUB.m_form_id = "FMAD101";
                String child_title = "User";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD102_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD102_open)
            {
                PCPUB.m_FMAD102_open = true;
                PCPUB.m_form_id = "FMAD102";
                String child_title = "Vendor";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD103_Click(object sender, EventArgs e)
        {

            if (!PCPUB.m_FMAD103_open)
            {
                PCPUB.m_FMAD103_open = true;
                PCPUB.m_form_id = "FMAD103";
                String child_title = "Yarn Color";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD104_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD104_open)
            {
                PCPUB.m_FMAD104_open = true;
                PCPUB.m_form_id = "FMAD104";
                String child_title = "Yarn Count";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD106_Click(object sender, EventArgs e)
        {

            if (!PCPUB.m_FMAD106_open)
            {
                PCPUB.m_FMAD106_open = true;
                PCPUB.m_form_id = "FMAD106";
                String child_title = "Design";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD107_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD107_open)
            {
                PCPUB.m_FMAD107_open = true;
                PCPUB.m_form_id = "FMAD107";
                String child_title = "Size";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD108_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD108_open)
            {
                PCPUB.m_FMAD108_open = true;
                PCPUB.m_form_id = "FMAD108";
                String child_title = "Yarn Name";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD109_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_FMAD109_open)
            {
                PCPUB.m_FMAD109_open = true;
                PCPUB.m_form_id = "FMAD109";
                String child_title = "City";
                load_form_child(child_title);
            }
        }

        private void tsmi_FMAD201_Click(object sender, EventArgs e)
        {
            PCPUB.m_form_id = "FMAD201";
            String child_title = "Dyeing Wages";
            Form childForm = new FMAD201();
            this.lbl_main_title.Text = child_title;
            childForm.Text = child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.ShowDialog();
        }

        private void tsmi_FMAD202_Click(object sender, EventArgs e)
        {
            PCPUB.m_form_id = "FMAD202";
            String child_title = "Weaving Wages";
            Form childForm = new FMAD202();
            this.lbl_main_title.Text = child_title;
            childForm.Text = child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.ShowDialog();
        }

        private void tsmi_FMAD203_Click(object sender, EventArgs e)
        {
            PCPUB.m_form_id = "FMAD203";
            String child_title = "Washing Wages";
            Form childForm = new FMAD203();
            this.lbl_main_title.Text = child_title;
            childForm.Text = child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.ShowDialog();
        }

        private void tsmi_FMAD204_Click(object sender, EventArgs e)
        {
            PCPUB.m_form_id = "FMAD204";
            String child_title = "Tailoring Wages";
            Form childForm = new FMAD204();
            this.lbl_main_title.Text = child_title;
            childForm.Text = child_title;
            childForm.Tag = PCPUB.m_form_id;
            childForm.ShowDialog();
        }

        // Reports

        // Yarn

        private void tsmi_RPTR102_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR102_open)
            {
                PCPUB.m_RPTR102_open = true;
                PCPUB.m_form_id = "RPTR102";
                PCREP.m_local_report_file = "RPTR102.rpt";
                String child_title = "Yarn Purchase Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR103_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR103_open)
            {
                PCPUB.m_RPTR103_open = true;
                PCPUB.m_form_id = "RPTR103";
                PCREP.m_local_report_file = "RPTR103.rpt";
                String child_title = "Yarn Purchase Vendor Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR104_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR104_open)
            {
                PCPUB.m_RPTR104_open = true;
                PCPUB.m_form_id = "RPTR104";
                PCREP.m_local_report_file = "RPTR104.rpt";
                String child_title = "Yarn Purchase City Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR105_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR105_open)
            {
                PCPUB.m_RPTR105_open = true;
                PCPUB.m_form_id = "RPTR105";
                PCREP.m_local_report_file = "RPTR105.rpt";
                String child_title = "Yarn Purchase Yarn Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR112_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR112_open)
            {
                PCPUB.m_RPTR112_open = true;
                PCPUB.m_form_id = "RPTR112";
                PCREP.m_local_report_file = "RPTR112.rpt";
                String child_title = "Yarn Sales Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR113_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR113_open)
            {
                PCPUB.m_RPTR113_open = true;
                PCPUB.m_form_id = "RPTR113";
                PCREP.m_local_report_file = "RPTR113.rpt";
                String child_title = "Yarn Sales Buyer Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR114_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR114_open)
            {
                PCPUB.m_RPTR114_open = true;
                PCPUB.m_form_id = "RPTR114";
                PCREP.m_local_report_file = "RPTR114.rpt";
                String child_title = "Yarn Sales City Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR115_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR115_open)
            {
                PCPUB.m_RPTR115_open = true;
                PCPUB.m_form_id = "RPTR115";
                PCREP.m_local_report_file = "RPTR115.rpt";
                String child_title = "Yarn Sales Yarn Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR122_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR122_open)
            {
                PCPUB.m_RPTR122_open = true;
                PCPUB.m_form_id = "RPTR122";
                PCREP.m_local_report_file = "RPTR122.rpt";
                String child_title = "Yarn Material Inward Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR123_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR123_open)
            {
                PCPUB.m_RPTR123_open = true;
                PCPUB.m_form_id = "RPTR123";
                PCREP.m_local_report_file = "RPTR123.rpt";
                String child_title = "Yarn Material Inward Vendor Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR124_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR124_open)
            {
                PCPUB.m_RPTR124_open = true;
                PCPUB.m_form_id = "RPTR124";
                PCREP.m_local_report_file = "RPTR124.rpt";
                String child_title = "Yarn Material Inward City Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR125_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR125_open)
            {
                PCPUB.m_RPTR125_open = true;
                PCPUB.m_form_id = "RPTR125";
                PCREP.m_local_report_file = "RPTR125.rpt";
                String child_title = "Yarn Material Inward Yarn Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR131_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR131_open)
            {
                PCPUB.m_RPTR131_open = true;
                PCPUB.m_form_id = "RPTR131";
                PCREP.m_local_report_file = "RPTR131.rpt";
                String child_title = "Yarn Purchase Outstanding Vendor Wise";
                load_form_report(child_title);
            }
        }

        // Dyeing

        private void tsmi_RPTR202_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR202_open)
            {
                PCPUB.m_RPTR202_open = true;
                PCPUB.m_form_id = "RPTR202";
                PCREP.m_local_report_file = "RPTR202.rpt";
                String child_title = "Dyeing Outward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR203_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR203_open)
            {
                PCPUB.m_RPTR203_open = true;
                PCPUB.m_form_id = "RPTR203";
                PCREP.m_local_report_file = "RPTR203.rpt";
                String child_title = "Dyeing Outward Dyer Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR204_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR204_open)
            {
                PCPUB.m_RPTR204_open = true;
                PCPUB.m_form_id = "RPTR204";
                PCREP.m_local_report_file = "RPTR204.rpt";
                String child_title = "Dyeing Outward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR205_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR205_open)
            {
                PCPUB.m_RPTR205_open = true;
                PCPUB.m_form_id = "RPTR205";
                PCREP.m_local_report_file = "RPTR205.rpt";
                String child_title = "Dyeing Outward Yarn Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR212_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR212_open)
            {
                PCPUB.m_RPTR212_open = true;
                PCPUB.m_form_id = "RPTR212";
                PCREP.m_local_report_file = "RPTR212.rpt";
                String child_title = "Dyeing Inward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR213_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR213_open)
            {
                PCPUB.m_RPTR213_open = true;
                PCPUB.m_form_id = "RPTR213";
                PCREP.m_local_report_file = "RPTR213.rpt";
                String child_title = "Dyeing Inward Dyer Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR214_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR214_open)
            {
                PCPUB.m_RPTR214_open = true;
                PCPUB.m_form_id = "RPTR214";
                PCREP.m_local_report_file = "RPTR214.rpt";
                String child_title = "Dyeing Inward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR215_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR215_open)
            {
                PCPUB.m_RPTR215_open = true;
                PCPUB.m_form_id = "RPTR215";
                PCREP.m_local_report_file = "RPTR215.rpt";
                String child_title = "Dyeing Inward Yarn Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR231_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR231_open)
            {
                PCPUB.m_RPTR231_open = true;
                PCPUB.m_form_id = "RPTR231";
                PCREP.m_local_report_file = "RPTR231.rpt";
                String child_title = "Dyeing Summary Report";
                load_form_report(child_title);
            }
        }

        // Weaving Reports

        private void tsmi_RPTR302_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR302_open)
            {
                PCPUB.m_RPTR302_open = true;
                PCPUB.m_form_id = "RPTR302";
                PCREP.m_local_report_file = "RPTR302.rpt";
                String child_title = "Weaving Outward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR303_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR303_open)
            {
                PCPUB.m_RPTR303_open = true;
                PCPUB.m_form_id = "RPTR303";
                PCREP.m_local_report_file = "RPTR303.rpt";
                String child_title = "Weaving Outward Weaver Wise Report";
                load_form_report(child_title);
            }
        }



        private void tsmi_RPTR304_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR304_open)
            {
                PCPUB.m_RPTR304_open = true;
                PCPUB.m_form_id = "RPTR304";
                PCREP.m_local_report_file = "RPTR304.rpt";
                String child_title = "Weaving Outward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR305_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR305_open)
            {
                PCPUB.m_RPTR305_open = true;
                PCPUB.m_form_id = "RPTR305";
                PCREP.m_local_report_file = "RPTR305.rpt";
                String child_title = "Weaving Outward Yarn Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR312_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR312_open)
            {
                PCPUB.m_RPTR312_open = true;
                PCPUB.m_form_id = "RPTR312";
                PCREP.m_local_report_file = "RPTR312.rpt";
                String child_title = "Weaving Inward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR313_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR313_open)
            {
                PCPUB.m_RPTR313_open = true;
                PCPUB.m_form_id = "RPTR313";
                PCREP.m_local_report_file = "RPTR313.rpt";
                String child_title = "Weaving Inward Weaver Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR314_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR314_open)
            {
                PCPUB.m_RPTR314_open = true;
                PCPUB.m_form_id = "RPTR314";
                PCREP.m_local_report_file = "RPTR314.rpt";
                String child_title = "Weaving Inward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR315_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR315_open)
            {
                PCPUB.m_RPTR315_open = true;
                PCPUB.m_form_id = "RPTR315";
                PCREP.m_local_report_file = "RPTR315.rpt";
                String child_title = "Weaving Inward Design Wise Report";
                load_form_report(child_title);
            }
        }
            
        private void tsmi_RPTR322_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR322_open)
            {
                PCPUB.m_RPTR322_open = true;
                PCPUB.m_form_id = "RPTR322";
                PCREP.m_local_report_file = "RPTR322.rpt";
                String child_title = "Weaving Adjustment Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR323_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR323_open)
            {
                PCPUB.m_RPTR323_open = true;
                PCPUB.m_form_id = "RPTR323";
                PCREP.m_local_report_file = "RPTR323.rpt";
                String child_title = "Weaving Adjustment Weaver Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR331_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR331_open)
            {
                PCPUB.m_RPTR331_open = true;
                PCPUB.m_form_id = "RPTR331";
                PCREP.m_local_report_file = "RPTR331.rpt";
                String child_title = "Weaving Outstanding";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR332_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR332_open)
            {
                PCPUB.m_RPTR332_open = true;
                PCPUB.m_form_id = "RPTR332";
                PCREP.m_local_report_file = "RPTR332.rpt";
                String child_title = "Weaving Summary Date Range";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR333_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR333_open)
            {
                PCPUB.m_RPTR333_open = true;
                PCPUB.m_form_id = "RPTR333";
                PCREP.m_local_report_file = "RPTR333.rpt";
                String child_title = "Weaving Weekly Wage Slip";
                load_form_report(child_title);
            }
        }

        // Washing Reports

        private void tsmi_RPTR402_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR402_open)
            {
                PCPUB.m_RPTR402_open = true;
                PCPUB.m_form_id = "RPTR402";
                PCREP.m_local_report_file = "RPTR402.rpt";
                String child_title = "Washing Outward Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR403_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR403_open)
            {
                PCPUB.m_RPTR403_open = true;
                PCPUB.m_form_id = "RPTR403";
                PCREP.m_local_report_file = "RPTR403.rpt";
                String child_title = "Washing Outward Washer Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR404_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR404_open)
            {
                PCPUB.m_RPTR404_open = true;
                PCPUB.m_form_id = "RPTR404";
                PCREP.m_local_report_file = "RPTR404.rpt";
                String child_title = "Washing Outward City Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR405_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR405_open)
            {
                PCPUB.m_RPTR405_open = true;
                PCPUB.m_form_id = "RPTR405";
                PCREP.m_local_report_file = "RPTR405.rpt";
                String child_title = "Washing Outward Design Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR412_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR412_open)
            {
                PCPUB.m_RPTR412_open = true;
                PCPUB.m_form_id = "RPTR412";
                PCREP.m_local_report_file = "RPTR412.rpt";
                String child_title = "Washing Inward Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR413_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR413_open)
            {
                PCPUB.m_RPTR413_open = true;
                PCPUB.m_form_id = "RPTR413";
                PCREP.m_local_report_file = "RPTR413.rpt";
                String child_title = "Washing Inward Washer Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR414_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR414_open)
            {
                PCPUB.m_RPTR414_open = true;
                PCPUB.m_form_id = "RPTR414";
                PCREP.m_local_report_file = "RPTR414.rpt";
                String child_title = "Washing Inward City Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR415_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR415_open)
            {
                PCPUB.m_RPTR415_open = true;
                PCPUB.m_form_id = "RPTR415";
                PCREP.m_local_report_file = "RPTR415.rpt";
                String child_title = "Washing Inward Design Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR431_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR431_open)
            {
                PCPUB.m_RPTR431_open = true;
                PCPUB.m_form_id = "RPTR431";
                PCREP.m_local_report_file = "RPTR431.rpt";
                String child_title = "Washing Summary Outstanding";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR432_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR432_open)
            {
                PCPUB.m_RPTR432_open = true;
                PCPUB.m_form_id = "RPTR432";
                PCREP.m_local_report_file = "RPTR432.rpt";
                String child_title = "Washing Summary Date Range";
                load_form_report(child_title);
            }
        }

        // Tailoring Reports

        private void tsmi_RPTR502_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR502_open)
            {
                PCPUB.m_RPTR502_open = true;
                PCPUB.m_form_id = "RPTR502";
                PCREP.m_local_report_file = "RPTR502.rpt";
                String child_title = "Tailoring Outward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR503_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR503_open)
            {
                PCPUB.m_RPTR503_open = true;
                PCPUB.m_form_id = "RPTR503";
                PCREP.m_local_report_file = "RPTR503.rpt";
                String child_title = "Tailoring Outward Tailor Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR504_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR504_open)
            {
                PCPUB.m_RPTR504_open = true;
                PCPUB.m_form_id = "RPTR504";
                PCREP.m_local_report_file = "RPTR504.rpt";
                String child_title = "Tailoring Outward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR505_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR505_open)
            {
                PCPUB.m_RPTR505_open = true;
                PCPUB.m_form_id = "RPTR505";
                PCREP.m_local_report_file = "RPTR505.rpt";
                String child_title = "Tailoring Outward Design Wise Report";
                load_form_report(child_title);
            }

        }

        private void tsmi_RPTR512_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR512_open)
            {
                PCPUB.m_RPTR512_open = true;
                PCPUB.m_form_id = "RPTR512";
                PCREP.m_local_report_file = "RPTR512.rpt";
                String child_title = "Tailoring Inward Date Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR513_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR513_open)
            {
                PCPUB.m_RPTR513_open = true;
                PCPUB.m_form_id = "RPTR513";
                PCREP.m_local_report_file = "RPTR513.rpt";
                String child_title = "Tailoring Inward Tailor Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR514_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR514_open)
            {
                PCPUB.m_RPTR514_open = true;
                PCPUB.m_form_id = "RPTR514";
                PCREP.m_local_report_file = "RPTR514.rpt";
                String child_title = "Tailoring Inward City Wise Report";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR515_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR515_open)
            {
                PCPUB.m_RPTR515_open = true;
                PCPUB.m_form_id = "RPTR515";
                PCREP.m_local_report_file = "RPTR515.rpt";
                String child_title = "Tailoring Inward Design Wise Report";
                load_form_report(child_title);
            }

        }

        private void tsmi_RPTR531_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR531_open)
            {
                PCPUB.m_RPTR531_open = true;
                PCPUB.m_form_id = "RPTR531";
                PCREP.m_local_report_file = "RPTR531.rpt";
                String child_title = "Tailoring Oustanding Summary";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR532_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR532_open)
            {
                PCPUB.m_RPTR532_open = true;
                PCPUB.m_form_id = "RPTR532";
                PCREP.m_local_report_file = "RPTR532.rpt";
                String child_title = "Tailoring Oustanding Summary";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR602_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR602_open)
            {
                PCPUB.m_RPTR602_open = true;
                PCPUB.m_form_id = "RPTR602";
                PCREP.m_local_report_file = "RPTR602.rpt";
                String child_title = "Payment Date Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR603_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR603_open)
            {
                PCPUB.m_RPTR603_open = true;
                PCPUB.m_form_id = "RPTR603";
                PCREP.m_local_report_file = "RPTR603.rpt";
                String child_title = "Payment Vendor Wise";
                load_form_report(child_title);
            }
        }

        private void tsmi_RPTR604_Click(object sender, EventArgs e)
        {
            if (!PCPUB.m_RPTR604_open)
            {
                PCPUB.m_RPTR604_open = true;
                PCPUB.m_form_id = "RPTR604";
                PCREP.m_local_report_file = "RPTR604.rpt";
                String child_title = "Payment Outstanding";
                load_form_report(child_title);
            }
        }

        private void lbl_tran_date_Click(object sender, EventArgs e)
        {

        }

        private void tsmi_RPTR300_Click(object sender, EventArgs e)
        {

        }

    }

}
